package com.v.im.businessapi.feign;


import com.v.im.businessapi.api.ImUserFriendServiceAPI;
import com.v.im.businessapi.dto.resultDTO.ImFriendGroupResultDTO;
import com.v.im.commonmodule.utils.constants.InterfaceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 *  用戶信息客戶端
 */
@FeignClient(name = InterfaceService.BUSINESS_SERVICE_NAME, fallback = ImUserFriendClientService.HystrixClientFallback.class)
public interface ImUserFriendClientService extends ImUserFriendServiceAPI {

    @Slf4j
    @Component
    class HystrixClientFallback implements ImUserFriendClientService {

        @Override
        public List<ImFriendGroupResultDTO> getUserFriends(String userId) {
            log.error("调用查询好友列表服务失败！");
            return null;
        }
    }
}
